<?php

namespace App\Model;


use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;

class EnterAnItemStatisticsFields extends BaseModel
{
    protected $connection = 'mysql';
    protected $fillable = ['desc','value','type'];
    
    public function createData(Request $request){
        return self::create($request->all());
    }
    
    public function getList(Request $request){
        $type = $request->input('type',0);
        return self::where('type',$type)->get();
    }
    
    public function deleteData($id){
        return self::destroy($id);
    }
    
    public function updateData(Request $request){
        return self::where('id', $request->input('id'))->update($request->only(['desc','value']));
    }
}
